import Header from '../components/header';
import { browserHistory } from 'react-router'
import * as UserAction from 'actions/user';
import * as ReactRedux from 'react-redux';

const mapStateToProps = (state) => {
  return {
    user: state.loginUser
  };
};

const mapDispatchToProps = (dispatch) => {
  return {
    onLogout: () => {
      return dispatch(UserAction.logout());
    },
    onProfile: () => {
      browserHistory.push('/profile')
    }
  };
};

export default ReactRedux.connect(mapStateToProps, mapDispatchToProps)(Header);
